package uk.co.biggroup.lotto.syndicate.dataset;

import java.io.Serializable;

public abstract class DataLine implements Serializable {
	//<line numbers='2,11,27,41,47,4,6' raffle='HPH211246' />
	private static final long serialVersionUID = 7526472295699776147L;
	protected String numbers;
	protected String raffle;
	protected int no = 0;
	protected int[] cnumber;
	protected int[] cnumberx;
	protected static final String DELIMITER = ",";
	protected boolean[] hit;
	protected int matchCounter = 0;
	protected int hitsNo = 0;
	/**
	 * @return the numbers
	 */
	protected String getNumbers() {
		return numbers;
	}
	/**
	 * @return the raffle
	 */
	protected String getRaffle() {
		return raffle;
	}
	/**
	 * @return the no
	 */
	protected int getNo() {
		return no;
	}
	/**
	 * @param no the no to set
	 */
	protected void setNo(int no) {
		this.no = no;
	}
	/**
	 * @return the cnumber
	 */
	protected int[] getCnumber() {
		return cnumber;
	}
	
	public String getNumberString(int index) {
		String val;
		if (cnumber[index] < 10) {
				val = "0" + Integer.toString(cnumber[index]);
			} else {
				val = Integer.toString(cnumber[index]);
			}
		return val;
	}
	
	public int getNoNumbers() {
		return cnumber.length;
	}
	
	public boolean getHit(int index) {
		return hit[index];
	}
	
	public int getHitsNo() {
		return hitsNo;
	}
	
	public int getMatchCounter() {
		return matchCounter;
	}
	/**
	 * @param cnumber the cnumber to set
	 */
	protected abstract void setLine(String numbers, String raffle, String lucky);
	protected abstract boolean comp(String a, int lcount);
}
